package com.bossly.metro.dom;

import java.util.ArrayList;

import android.graphics.Point;
import android.location.Location;

public class Station {
	private final int m_id;
	private final int m_line;
	private ArrayList<Station> m_stations;
	private final String m_name;
	private final String m_lineName;
	private Location m_location;

	public int next = -1;
	public int prev = -1;

	public int tx = 0;
	public int ty = 0;

	public Point m_screenLocation;

	public Station(int id, int line, String lineName, String name) {
		m_id = id;
		m_line = line;
		m_name = name;
		m_lineName = lineName;
	}

	public int getId() {
		return m_id;
	}

	public int getLine() {
		return m_line;
	}

	public String getName() {
		return m_name;
	}

	public String getLineName() {
		return m_lineName;
	}

	public void setLocation(Location loc) {
		m_location = loc;
	}

	public Location getLocation() {
		return m_location;
	}

	public void addStation(Station station) {
		if (m_stations == null) {
			m_stations = new ArrayList<Station>();
		}

		m_stations.add(station);
	}

	public Station getStation(int position) {
		return (m_stations != null) ? m_stations.get(position) : null;
	}

	public int getStationCount() {
		return m_stations != null ? m_stations.size() : 0;
	}

	public Point getSreenLocation() {
		return m_screenLocation;
	}

	public void setSreenLocation(Point point) {
		m_screenLocation = point;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return getName();
	}
}
